package com.lagou.bean;

/**
 * <h1>监控实体类:保存方法每次执行情况</h1>
 * @author yzh
 */
public class MonitorBean implements Comparable<MonitorBean> {

    /**
     * 执行开始时间
     */
    private Long startTime = 0L;

    /**
     * 执行结束时间
     */
    private Long endTime = 0L;

    /**
     * 执行耗时
     */
    private Long invokeTime = 0L;

    /**
     * 执行时间所处的单位时间
     */
    private Long callNum = 0L;

    @Override
    public int compareTo(MonitorBean monitorBean) {
        return this.invokeTime.compareTo(monitorBean.invokeTime);
    }

    public MonitorBean(Long startTime, Long endTime, Long invokeTime, Long callNum) {
        this.startTime = startTime;
        this.endTime = endTime;
        this.invokeTime = invokeTime;
        this.callNum = callNum;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public Long getInvokeTime() {
        return invokeTime;
    }

    public void setInvokeTime(Long invokeTime) {
        this.invokeTime = invokeTime;
    }

    public Long getCallNum() {
        return callNum;
    }

    public void setCallNum(Long callNum) {
        this.callNum = callNum;
    }

    @Override
    public String toString() {
        return "MonitorBean{" +
                "startTime=" + startTime +
                ", endTime=" + endTime +
                ", invokeTime=" + invokeTime +
                ", callNum=" + callNum +
                '}';
    }
}
